#include <REGX52.H>
#include "delay.h"
#include "key.h"

//ETV1
sbit LED1 = P1^0;
#define LED2 P1_1
//ETV1

#define LED_ON 0
#define LED_OFF 1

//函数功能：按键KEY1点亮LED1,按键KEY2熄灭LED1
//2024.9.11
void main()
{
    unsigned char keyNum = 0xff;
    
	while(1) {        
        keyNum = KEY_Getvalue();		//获取独立按键键码
		if(keyNum == KEYNUM1) {			//如果按键按下        
			LED1 = LED_ON;		//LED1输出0，点亮
		} else if (keyNum == KEYNUM2) {
			LED1 = LED_OFF;		//LED1输出1，熄灭
		}
	}
}
